
package org.dromara.system.api.feign;

/**
 * @author: zhou shuai
 * @date: 2024/10/5 17:10
 * @version: v1
 */

import org.dromara.common.core.domain.R;
import org.dromara.system.api.domain.vo.RemoteDictDataVo;
import org.dromara.system.api.domain.vo.RemoteDictTypeVo;
import org.dromara.system.api.feign.fallback.SystemDictFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

import static org.dromara.common.core.constant.ServerNameConstants.SYSTEM_SERVER_NAME;

@FeignClient(contextId = "system-dict-api", name = SYSTEM_SERVER_NAME, fallbackFactory = SystemDictFallBack.class)
public interface SystemDictClient {

    /**
     * 根据字典类型查询字典类型
     *
     * @param dictType 字典类型
     * @return 字典类型
     */
    @GetMapping(value = "/api/system/dict/type/byType")
    R<RemoteDictTypeVo> selectDictTypeByType(@RequestParam("dictType") String dictType);

    /**
     * 根据字典类型查询字典数据
     *
     * @param dictType 字典类型
     * @return 字典数据集合信息
     */
    @GetMapping(value = "/api/system/dict/data/byType")
    R<List<RemoteDictDataVo>> selectDictDataByType(@RequestParam("dictType") String dictType);

}
